<?php
include_once XOOPS_ROOT_PATH."/class/template.php";
	$XoopsTpl = new XoopsTpl();

function neoobject_admin_itemtype_main(){
	global $XoopsTpl;
	$itemH = & xoops_getmodulehandler('item');
	xoops_cp_header();
	$XoopsTpl->assign('itemhandler',$itemH);
	
	echo $XoopsTpl->fetch('db:neoobject_admin_mainmenu.html');
  	echo $XoopsTpl->fetch('db:neoobject_admin_itemtype_main.html');

	
	xoops_cp_footer();
}
function neoobject_admin_itemtype_create_ok(){
	global $eh,$cityH,$regionH,$countryH,$itemH;
	$itemH = & xoops_getmodulehandler('item');
	$itemtypeO = $itemH->typeH->create();
	$itemtypeO->setFormVars($_POST,"itemtype_");
	$itemH->typeH->insert($itemtypeO);
	redirect_header("index.php?type=itemtype");
		exit();
}


function neoobject_admin_itemtype_edit(){
	global $XoopsTpl;
	$itemH = & xoops_getmodulehandler('item');
	xoops_cp_header();
	
	echo $XoopsTpl->fetch('db:neoobject_admin_mainmenu.html');
	
	$itemtypeO = $itemH->typeH->get($_GET['id']);
	
	$XoopsTpl->assign_by_ref("itemtype",$itemtypeO);
	

echo $XoopsTpl->fetch('db:neoobject_admin_itemtype_edit.html');
	xoops_cp_footer();

	
}
function neoobject_admin_itemtype_edit_ok(){
	$itemH = & xoops_getmodulehandler('item');
	$itemtypeO = $itemH->typeH->get($_GET['id']);
	$itemtypeO->setFormVars($_POST,"itemtype_");
	$itemH->typeH->insert($itemtypeO);
		redirect_header("index.php?type=itemtype");
		exit();

}
function neoobject_admin_itemtype_delete_ok(){
	$itemH = & xoops_getmodulehandler('item');
	$itemtypeO = $itemH->typeH->get($_GET['id']);

	$itemH->typeH->delete($itemtypeO);

 	
		redirect_header("index.php?type=itemtype");
		exit();

}


?>
